<template>
	<view class="container">
		<view v-if="data" >
			<view class="title">{{ data.knowledgeTitle }}</view>
			<view class="desc">
				<view class="browse">
					浏览量：{{ data.browse }}
				</view>
				<view class="createtime">
					发布时间：{{ data.createTime }}
				</view>
			</view>
			<view>
				<u-parse :content="data.knowledgeContent"></u-parse>
			</view>
			<view class="hr"></view>
			<!-- 评分 -->
			<view class="rat">
				当前评分：{{ data.rating }}分
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				//运动知识ID
				id: '',
				data: null
			}
		},
		onLoad(option) {
			this.id = option.id;
			this.fetchList();
		},
		methods: {
			//获取运动知识
			fetchList() {
				uni.showLoading({
					title: "加载中",
					mask: true
				})
				var params = {};
				params.healthKnowledgeId = this.id;
				params.userId = uni.getStorageSync('userId');
				this.$request({
					url: '/blade-merchant-app/merchant-app/sportKnowledge/detail',
					data: params
				}).then(res => {
					setTimeout(() => {
						uni.hideLoading();
						this.data = res.data;
					}, 300);
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	page {
		height: 100%;
		background: #ffffff;
		
		.container {
			padding: 30rpx;
			
			.title {
				font-size: 38rpx;
			}
			.desc {
				display: flex;padding: 30rpx 0rpx;
				.browse {
					width: 30%;font-size: 29rpx;
				}
				.createtime {
					width: 70%;font-size: 29rpx;text-align: right;
				}
				
			}
			.hr {
				height: 30rpx;border-top: 1px solid #e5e5e5;
			}
			.rat {
				height: 50rpx;  line-height: 50rpx;  font-size: 33rpx; color: #155CCF;
			}
		}
	}
	
	
	.u-content {
        padding: 20rpx 25rpx;
		font-size: 28rpx;
    }
</style>
